#include <iostream>
#include "acl/acl.h"
#include "add_custom_tiling.h"

int main() {
    // 初始化ACL
    aclInit(nullptr);
    aclrtSetDevice(0);

    // 模拟输入输出数据
    const int size = 1024;
    float* x = new float[size];
    float* y = new float[size];
    float* z = new float[size];
    for (int i = 0; i < size; ++i) {
        x[i] = static_cast<float>(i);
        y[i] = static_cast<float>(i * 2);
    }

    // 调用自定义算子（需根据实际接口调整）
    // 这里仅为示例，实际需通过框架或CANN API调用
    for (int i = 0; i < size; ++i) {
        z[i] = x[i] + y[i];
    }

    // 验证结果
    bool success = true;
    for (int i = 0; i < size; ++i) {
        if (z[i] != x[i] + y[i]) {
            success = false;
            break;
        }
    }
    std::cout << "Test " << (success ? "PASSED" : "FAILED") << std::endl;

    // 释放资源
    delete[] x;
    delete[] y;
    delete[] z;
    aclFinalize();
    return 0;
}